<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDataStream Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDataStream Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QDataStream class provides serialization of binary data to a
<a href="qiodevice.html">QIODevice</a>. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdatastream.html#ByteOrder-enum">ByteOrder</a></b> { BigEndian, LittleEndian }</li><li><div class="fn" />enum <b><a href="qdatastream.html#FloatingPointPrecision-enum">FloatingPointPrecision</a></b> { SinglePrecision, DoublePrecision }</li><li><div class="fn" />enum <b><a href="qdatastream.html#Status-enum">Status</a></b> { Ok, ReadPastEnd, ReadCorruptData }</li><li><div class="fn" />enum <b><a href="qdatastream.html#Version-enum">Version</a></b> { Qt_1_0, Qt_2_0, Qt_2_1, Qt_3_0, ..., Qt_4_7 }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdatastream.html#QDataStream">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#QDataStream-2">__init__</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qdatastream.html#QDataStream-3">__init__</a></b> (<i>self</i>, QByteArray, QIODevice.OpenMode&#160;<i>flags</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#QDataStream-4">__init__</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" />bool <b><a href="qdatastream.html#atEnd">atEnd</a></b> (<i>self</i>)</li><li><div class="fn" />ByteOrder <b><a href="qdatastream.html#byteOrder">byteOrder</a></b> (<i>self</i>)</li><li><div class="fn" />QIODevice <b><a href="qdatastream.html#device">device</a></b> (<i>self</i>)</li><li><div class="fn" />FloatingPointPrecision <b><a href="qdatastream.html#floatingPointPrecision">floatingPointPrecision</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdatastream.html#readBool">readBool</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qdatastream.html#readBytes">readBytes</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdatastream.html#readDouble">readDouble</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qdatastream.html#readFloat">readFloat</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readInt">readInt</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readInt16">readInt16</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readInt32">readInt32</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readInt64">readInt64</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qdatastream.html#readInt8">readInt8</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qdatastream.html#readQString">readQString</a></b> (<i>self</i>)</li><li><div class="fn" />QStringList <b><a href="qdatastream.html#readQStringList">readQStringList</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qdatastream.html#readQVariant">readQVariant</a></b> (<i>self</i>)</li><li><div class="fn" />dict-of-QString-QVariant <b><a href="qdatastream.html#readQVariantHash">readQVariantHash</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-QVariant <b><a href="qdatastream.html#readQVariantList">readQVariantList</a></b> (<i>self</i>)</li><li><div class="fn" />dict-of-QString-QVariant <b><a href="qdatastream.html#readQVariantMap">readQVariantMap</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qdatastream.html#readRawData">readRawData</a></b> (<i>self</i>, int&#160;<i>len</i>)</li><li><div class="fn" />str <b><a href="qdatastream.html#readString">readString</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readUInt16">readUInt16</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readUInt32">readUInt32</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#readUInt64">readUInt64</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qdatastream.html#readUInt8">readUInt8</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#resetStatus">resetStatus</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#setByteOrder">setByteOrder</a></b> (<i>self</i>, ByteOrder)</li><li><div class="fn" /><b><a href="qdatastream.html#setDevice">setDevice</a></b> (<i>self</i>, QIODevice)</li><li><div class="fn" /><b><a href="qdatastream.html#setFloatingPointPrecision">setFloatingPointPrecision</a></b> (<i>self</i>, FloatingPointPrecision&#160;<i>precision</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#setStatus">setStatus</a></b> (<i>self</i>, Status&#160;<i>status</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#setVersion">setVersion</a></b> (<i>self</i>, int&#160;<i>v</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#skipRawData">skipRawData</a></b> (<i>self</i>, int&#160;<i>len</i>)</li><li><div class="fn" />Status <b><a href="qdatastream.html#status">status</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#unsetDevice">unsetDevice</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#version">version</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeBool">writeBool</a></b> (<i>self</i>, bool&#160;<i>i</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#writeBytes">writeBytes</a></b> (<i>self</i>, str)</li><li><div class="fn" /><b><a href="qdatastream.html#writeDouble">writeDouble</a></b> (<i>self</i>, float&#160;<i>f</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeFloat">writeFloat</a></b> (<i>self</i>, float&#160;<i>f</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeInt">writeInt</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeInt16">writeInt16</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeInt32">writeInt32</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeInt64">writeInt64</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeInt8">writeInt8</a></b> (<i>self</i>, str&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQString">writeQString</a></b> (<i>self</i>, QString&#160;<i>qstr</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQStringList">writeQStringList</a></b> (<i>self</i>, QStringList&#160;<i>qstrlst</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQVariant">writeQVariant</a></b> (<i>self</i>, QVariant&#160;<i>qvar</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQVariantHash">writeQVariantHash</a></b> (<i>self</i>, dict-of-QString-QVariant&#160;<i>qvarhash</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQVariantList">writeQVariantList</a></b> (<i>self</i>, list-of-QVariant&#160;<i>qvarlst</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeQVariantMap">writeQVariantMap</a></b> (<i>self</i>, dict-of-QString-QVariant&#160;<i>qvarmap</i>)</li><li><div class="fn" />int <b><a href="qdatastream.html#writeRawData">writeRawData</a></b> (<i>self</i>, str)</li><li><div class="fn" /><b><a href="qdatastream.html#writeString">writeString</a></b> (<i>self</i>, str&#160;<i>str</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeUInt16">writeUInt16</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeUInt32">writeUInt32</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeUInt64">writeUInt64</a></b> (<i>self</i>, int&#160;<i>i</i>)</li><li><div class="fn" /><b><a href="qdatastream.html#writeUInt8">writeUInt8</a></b> (<i>self</i>, str&#160;<i>i</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__">__lshift__</a></b> (<i>self</i>, QColor)</li><li><div class="fn" />QDataStream <b><a href="qtnetwork.html#__lshift__">__lshift__</a></b> (<i>self</i>, QNetworkCacheMetaData)</li><li><div class="fn" />QDataStream <b><a href="qtscript.html#__lshift__">__lshift__</a></b> (<i>self</i>, QScriptContextInfo)</li><li><div class="fn" />QDataStream <b><a href="qtwebkit.html#__lshift__">__lshift__</a></b> (<i>self</i>, QWebHistory)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-2">__lshift__</a></b> (<i>self</i>, QBrush)</li><li><div class="fn" />QDataStream <b><a href="qtnetwork.html#__lshift__-2">__lshift__</a></b> (<i>self</i>, QHostAddress)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-3">__lshift__</a></b> (<i>self</i>, QCursor&#160;<i>cursor</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-4">__lshift__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-5">__lshift__</a></b> (<i>self</i>, QIcon)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-6">__lshift__</a></b> (<i>self</i>, QImage)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-7">__lshift__</a></b> (<i>self</i>, QKeySequence&#160;<i>ks</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-8">__lshift__</a></b> (<i>self</i>, QListWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-9">__lshift__</a></b> (<i>self</i>, QMatrix)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-10">__lshift__</a></b> (<i>self</i>, QMatrix4x4)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-11">__lshift__</a></b> (<i>self</i>, QPainterPath)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-12">__lshift__</a></b> (<i>self</i>, QPalette&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-13">__lshift__</a></b> (<i>self</i>, QPen)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-14">__lshift__</a></b> (<i>self</i>, QPicture&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-15">__lshift__</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-16">__lshift__</a></b> (<i>self</i>, QPolygonF&#160;<i>array</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-17">__lshift__</a></b> (<i>self</i>, QPolygon&#160;<i>polygon</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-18">__lshift__</a></b> (<i>self</i>, QQuaternion)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-19">__lshift__</a></b> (<i>self</i>, QRegion)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-20">__lshift__</a></b> (<i>self</i>, QSizePolicy)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-22">__lshift__</a></b> (<i>self</i>, QStandardItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-23">__lshift__</a></b> (<i>self</i>, QTableWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-24">__lshift__</a></b> (<i>self</i>, QTextLength)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-25">__lshift__</a></b> (<i>self</i>, QTextFormat)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-26">__lshift__</a></b> (<i>self</i>, QTransform)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-27">__lshift__</a></b> (<i>self</i>, QTreeWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-28">__lshift__</a></b> (<i>self</i>, QVector2D)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-29">__lshift__</a></b> (<i>self</i>, QVector3D)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__lshift__-30">__lshift__</a></b> (<i>self</i>, QVector4D)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__">__rshift__</a></b> (<i>self</i>, QColor)</li><li><div class="fn" />QDataStream <b><a href="qtnetwork.html#__rshift__">__rshift__</a></b> (<i>self</i>, QNetworkCacheMetaData)</li><li><div class="fn" />QDataStream <b><a href="qtscript.html#__rshift__">__rshift__</a></b> (<i>self</i>, QScriptContextInfo)</li><li><div class="fn" />QDataStream <b><a href="qtwebkit.html#__rshift__">__rshift__</a></b> (<i>self</i>, QWebHistory)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-2">__rshift__</a></b> (<i>self</i>, QBrush)</li><li><div class="fn" />QDataStream <b><a href="qtnetwork.html#__rshift__-2">__rshift__</a></b> (<i>self</i>, QHostAddress)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-3">__rshift__</a></b> (<i>self</i>, QCursor&#160;<i>cursor</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-4">__rshift__</a></b> (<i>self</i>, QFont)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-5">__rshift__</a></b> (<i>self</i>, QIcon)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-6">__rshift__</a></b> (<i>self</i>, QImage)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-7">__rshift__</a></b> (<i>self</i>, QKeySequence&#160;<i>ks</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-8">__rshift__</a></b> (<i>self</i>, QListWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-9">__rshift__</a></b> (<i>self</i>, QMatrix)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-10">__rshift__</a></b> (<i>self</i>, QMatrix4x4)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-11">__rshift__</a></b> (<i>self</i>, QPainterPath)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-12">__rshift__</a></b> (<i>self</i>, QPalette&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-13">__rshift__</a></b> (<i>self</i>, QPen)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-14">__rshift__</a></b> (<i>self</i>, QPicture&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-15">__rshift__</a></b> (<i>self</i>, QPixmap)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-16">__rshift__</a></b> (<i>self</i>, QPolygonF&#160;<i>array</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-17">__rshift__</a></b> (<i>self</i>, QPolygon&#160;<i>polygon</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-18">__rshift__</a></b> (<i>self</i>, QQuaternion)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-19">__rshift__</a></b> (<i>self</i>, QRegion)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-20">__rshift__</a></b> (<i>self</i>, QSizePolicy)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-22">__rshift__</a></b> (<i>self</i>, QStandardItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-23">__rshift__</a></b> (<i>self</i>, QTableWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-24">__rshift__</a></b> (<i>self</i>, QTextLength)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-25">__rshift__</a></b> (<i>self</i>, QTextFormat)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-26">__rshift__</a></b> (<i>self</i>, QTransform)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-27">__rshift__</a></b> (<i>self</i>, QTreeWidgetItem&#160;<i>item</i>)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-28">__rshift__</a></b> (<i>self</i>, QVector2D)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-29">__rshift__</a></b> (<i>self</i>, QVector3D)</li><li><div class="fn" />QDataStream <b><a href="qtgui.html#__rshift__-30">__rshift__</a></b> (<i>self</i>, QVector4D)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__">__lshift__</a></b> (<i>self</i>, QBitArray)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-2">__lshift__</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-3">__lshift__</a></b> (<i>self</i>, QChar)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-4">__lshift__</a></b> (<i>self</i>, QDate)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-5">__lshift__</a></b> (<i>self</i>, QTime)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-6">__lshift__</a></b> (<i>self</i>, QDateTime)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-7">__lshift__</a></b> (<i>self</i>, QEasingCurve)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-8">__lshift__</a></b> (<i>self</i>, QLine)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-9">__lshift__</a></b> (<i>self</i>, QLineF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-10">__lshift__</a></b> (<i>self</i>, QLocale)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-11">__lshift__</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-12">__lshift__</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-13">__lshift__</a></b> (<i>self</i>, QRect)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-14">__lshift__</a></b> (<i>self</i>, QRectF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-15">__lshift__</a></b> (<i>self</i>, QRegExp&#160;<i>regExp</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-16">__lshift__</a></b> (<i>self</i>, QSize)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-17">__lshift__</a></b> (<i>self</i>, QSizeF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-18">__lshift__</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-19">__lshift__</a></b> (<i>self</i>, QStringList&#160;<i>list</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-20">__lshift__</a></b> (<i>self</i>, QUrl)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-21">__lshift__</a></b> (<i>self</i>, QUuid)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-22">__lshift__</a></b> (<i>self</i>, QVariant&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__lshift__-23">__lshift__</a></b> (<i>self</i>, Type&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__">__rshift__</a></b> (<i>self</i>, QBitArray)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-2">__rshift__</a></b> (<i>self</i>, QByteArray)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-3">__rshift__</a></b> (<i>self</i>, QChar)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-4">__rshift__</a></b> (<i>self</i>, QDate)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-5">__rshift__</a></b> (<i>self</i>, QTime)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-6">__rshift__</a></b> (<i>self</i>, QDateTime)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-7">__rshift__</a></b> (<i>self</i>, QEasingCurve)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-8">__rshift__</a></b> (<i>self</i>, QLine)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-9">__rshift__</a></b> (<i>self</i>, QLineF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-10">__rshift__</a></b> (<i>self</i>, QLocale)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-11">__rshift__</a></b> (<i>self</i>, QPoint)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-12">__rshift__</a></b> (<i>self</i>, QPointF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-13">__rshift__</a></b> (<i>self</i>, QRect)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-14">__rshift__</a></b> (<i>self</i>, QRectF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-15">__rshift__</a></b> (<i>self</i>, QRegExp&#160;<i>regExp</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-16">__rshift__</a></b> (<i>self</i>, QSize)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-17">__rshift__</a></b> (<i>self</i>, QSizeF)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-18">__rshift__</a></b> (<i>self</i>, QString)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-19">__rshift__</a></b> (<i>self</i>, QStringList&#160;<i>list</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-20">__rshift__</a></b> (<i>self</i>, QUrl)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-21">__rshift__</a></b> (<i>self</i>, QUuid)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-22">__rshift__</a></b> (<i>self</i>, QVariant&#160;<i>p</i>)</li><li><div class="fn" />QDataStream <b><a href="qdatastream.html#__rshift__-23">__rshift__</a></b> (<i>self</i>, Type&#160;<i>p</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDataStream class provides serialization of binary data to a
<a href="qiodevice.html">QIODevice</a>.</p>
<p>A data stream is a binary stream of encoded information which is
100% independent of the host computer's operating system, CPU or
byte order. For example, a data stream that is written by a PC
under Windows can be read by a Sun SPARC running Solaris.</p>
<p>You can also use a data stream to read/write <a href="#raw">raw
unencoded binary data</a>. If you want a "parsing" input stream,
see <a href="qtextstream.html">QTextStream</a>.</p>
<p>The QDataStream class implements the serialization of C++'s
basic data types, like <tt>char</tt>, <tt>short</tt>, <tt>int</tt>,
<tt>char *</tt>, etc. Serialization of more complex data is
accomplished by breaking up the data into primitive units.</p>
<p>A data stream cooperates closely with a <a href="qiodevice.html">QIODevice</a>. A <a href="qiodevice.html">QIODevice</a> represents an input/output medium
one can read data from and write data to. The <a href="qfile.html">QFile</a> class is an example of an I/O device.</p>
<p>Example (write binary data to a stream):</p>
<pre class="cpp">
 <span class="type"><a href="qfile.html">QFile</a></span> file(<span class="string">"file.dat"</span>);
 file<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">.</span>WriteOnly);
 <span class="type">QDataStream</span> out(<span class="operator">&amp;</span>file);   <span class="comment">// we will serialize the data into the file</span>
 out <span class="operator">&lt;</span><span class="operator">&lt;</span> <span class="type"><a href="qstring.html">QString</a></span>(<span class="string">"the answer is"</span>);   <span class="comment">// serialize a string</span>
 out <span class="operator">&lt;</span><span class="operator">&lt;</span> (<span class="type"><a href="qtcore.html#qint32-typedef">qint32</a></span>)<span class="number">42</span>;        <span class="comment">// serialize an integer</span>
</pre>
<p>Example (read binary data from a stream):</p>
<pre class="cpp">
 <span class="type"><a href="qfile.html">QFile</a></span> file(<span class="string">"file.dat"</span>);
 file<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">.</span>ReadOnly);
 <span class="type">QDataStream</span> in(<span class="operator">&amp;</span>file);    <span class="comment">// read the data serialized from the file</span>
 <span class="type"><a href="qstring.html">QString</a></span> str;
 <span class="type"><a href="qtcore.html#qint32-typedef">qint32</a></span> a;
 in <span class="operator">&gt;</span><span class="operator">&gt;</span> str <span class="operator">&gt;</span><span class="operator">&gt;</span> a;           <span class="comment">// extract "the answer is" and 42</span>
</pre>
<p>Each item written to the stream is written in a predefined
binary format that varies depending on the item's type. Supported
Qt types include <a href="qbrush.html">QBrush</a>, <a href="qcolor.html">QColor</a>, <a href="qdatetime.html">QDateTime</a>,
<a href="qfont.html">QFont</a>, <a href="qpixmap.html">QPixmap</a>,
<a href="qstring.html">QString</a>, <a href="qvariant.html">QVariant</a> and many others. For the complete list
of all Qt types supporting data streaming see <a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<p>For integers it is best to always cast to a Qt integer type for
writing, and to read back into the same Qt integer type. This
ensures that you get integers of the size you want and insulates
you from compiler and platform differences.</p>
<p>To take one example, a <tt>char *</tt> string is written as a
32-bit integer equal to the length of the string including the '\0'
byte, followed by all the characters of the string including the
'\0' byte. When reading a <tt>char *</tt> string, 4 bytes are read
to create the 32-bit length value, then that many characters for
the <tt>char *</tt> string including the '\0' terminator are
read.</p>
<p>The initial I/O device is usually set in the constructor, but
can be changed with <a href="qdatastream.html#setDevice">setDevice</a>(). If you've reached the
end of the data (or if there is no I/O device set) <a href="qdatastream.html#atEnd">atEnd</a>() will return true.</p>
<a id="versioning" name="versioning" />
<h3>Versioning</h3>
<p>QDataStream's binary format has evolved since Qt 1.0, and is
likely to continue evolving to reflect changes done in Qt. When
inputting or outputting complex types, it's very important to make
sure that the same version of the stream (<a href="qdatastream.html#version">version</a>()) is used for reading and
writing. If you need both forward and backward compatibility, you
can hardcode the version number in the application:</p>
<pre class="cpp">
 stream<span class="operator">.</span>setVersion(<span class="type">QDataStream</span><span class="operator">.</span>Qt_4_0);
</pre>
<p>If you are producing a new binary data format, such as a file
format for documents created by your application, you could use a
QDataStream to write the data in a portable format. Typically, you
would write a brief header containing a magic string and a version
number to give yourself room for future expansion. For example:</p>
<pre class="cpp">
 <span class="type"><a href="qfile.html">QFile</a></span> file(<span class="string">"file.xxx"</span>);
 file<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">.</span>WriteOnly);
 <span class="type">QDataStream</span> out(<span class="operator">&amp;</span>file);

 <span class="comment">// Write a header with a "magic number" and a version</span>
 out <span class="operator">&lt;</span><span class="operator">&lt;</span> (<span class="type"><a href="qtcore.html#quint32-typedef">quint32</a></span>)<span class="number">0xA0B0C0D0</span>;
 out <span class="operator">&lt;</span><span class="operator">&lt;</span> (<span class="type"><a href="qtcore.html#qint32-typedef">qint32</a></span>)<span class="number">123</span>;

 out<span class="operator">.</span>setVersion(<span class="type">QDataStream</span><span class="operator">.</span>Qt_4_0);

 <span class="comment">// Write the data</span>
 out <span class="operator">&lt;</span><span class="operator">&lt;</span> lots_of_interesting_data;
</pre>
<p>Then read it in with:</p>
<pre class="cpp">
 <span class="type"><a href="qfile.html">QFile</a></span> file(<span class="string">"file.xxx"</span>);
 file<span class="operator">.</span>open(<span class="type"><a href="qiodevice.html">QIODevice</a></span><span class="operator">.</span>ReadOnly);
 <span class="type">QDataStream</span> in(<span class="operator">&amp;</span>file);

 <span class="comment">// Read and check the header</span>
 <span class="type"><a href="qtcore.html#quint32-typedef">quint32</a></span> magic;
 in <span class="operator">&gt;</span><span class="operator">&gt;</span> magic;
 <span class="keyword">if</span> (magic <span class="operator">!</span><span class="operator">=</span> <span class="number">0xA0B0C0D0</span>)
     <span class="keyword">return</span> XXX_BAD_FILE_FORMAT;

 <span class="comment">// Read the version</span>
 <span class="type"><a href="qtcore.html#qint32-typedef">qint32</a></span> version;
 in <span class="operator">&gt;</span><span class="operator">&gt;</span> version;
 <span class="keyword">if</span> (version <span class="operator">&lt;</span> <span class="number">100</span>)
     <span class="keyword">return</span> XXX_BAD_FILE_TOO_OLD;
 <span class="keyword">if</span> (version <span class="operator">&gt;</span> <span class="number">123</span>)
     <span class="keyword">return</span> XXX_BAD_FILE_TOO_NEW;

 <span class="keyword">if</span> (version <span class="operator">&lt;</span><span class="operator">=</span> <span class="number">110</span>)
     in<span class="operator">.</span>setVersion(<span class="type">QDataStream</span><span class="operator">.</span>Qt_3_2);
 <span class="keyword">else</span>
     in<span class="operator">.</span>setVersion(<span class="type">QDataStream</span><span class="operator">.</span>Qt_4_0);

 <span class="comment">// Read the data</span>
 in <span class="operator">&gt;</span><span class="operator">&gt;</span> lots_of_interesting_data;
 <span class="keyword">if</span> (version <span class="operator">&gt;</span><span class="operator">=</span> <span class="number">120</span>)
     in <span class="operator">&gt;</span><span class="operator">&gt;</span> data_new_in_XXX_version_1_2;
 in <span class="operator">&gt;</span><span class="operator">&gt;</span> other_interesting_data;
</pre>
<p>You can select which byte order to use when serializing data.
The default setting is big endian (MSB first). Changing it to
little endian breaks the portability (unless the reader also
changes to little endian). We recommend keeping this setting unless
you have special requirements.</p>
<a id="raw" name="raw" /><a id="reading-and-writing-raw-binary-data" name="reading-and-writing-raw-binary-data" />
<h3>Reading and writing raw binary data</h3>
<p>You may wish to read/write your own raw binary data to/from the
data stream directly. Data may be read from the stream into a
preallocated <tt>char *</tt> using <a href="qdatastream.html#readRawData">readRawData</a>(). Similarly data
can be written to the stream using <a href="qdatastream.html#writeRawData">writeRawData</a>(). Note that any
encoding/decoding of the data must be done by you.</p>
<p>A similar pair of functions is <a href="qdatastream.html#readBytes">readBytes</a>() and <a href="qdatastream.html#writeBytes">writeBytes</a>(). These differ from
their <i>raw</i> counterparts as follows: <a href="qdatastream.html#readBytes">readBytes</a>() reads a quint32 which
is taken to be the length of the data to be read, then that number
of bytes is read into the preallocated <tt>char *</tt>; <a href="qdatastream.html#writeBytes">writeBytes</a>() writes a quint32
containing the length of the data, followed by the data. Note that
any encoding/decoding of the data (apart from the length quint32)
must be done by you.</p>
<a id="reading-and-writing-qt-collection-classes" name="reading-and-writing-qt-collection-classes" />
<h3>Reading and writing Qt collection classes</h3>
<p>The Qt container classes can also be serialized to a
QDataStream. These include <a href="qlist.html">QList</a>, <a href="qlinkedlist.html">QLinkedList</a>, <a href="qvector.html">QVector</a>, <a href="qset.html">QSet</a>, <a href="qhash.html">QHash</a>, and <a href="qmap.html">QMap</a>. The
stream operators are declared as non-members of the classes.</p>
<a id="serializing-qt-classes" name="serializing-qt-classes" /><a id="reading-and-writing-other-qt-classes" name="reading-and-writing-other-qt-classes" />
<h3>Reading and writing other Qt classes.</h3>
<p>In addition to the overloaded stream operators documented here,
any Qt classes that you might want to serialize to a QDataStream
will have appropriate stream operators declared as non-member of
the class:</p>
<pre class="cpp">
 <span class="type">QDataStream</span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span>(<span class="type">QDataStream</span> <span class="operator">&amp;</span><span class="operator">,</span> <span class="keyword">const</span> <span class="type">QXxx</span> <span class="operator">&amp;</span>);
 <span class="type">QDataStream</span> <span class="operator">&amp;</span><span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span>(<span class="type">QDataStream</span> <span class="operator">&amp;</span><span class="operator">,</span> <span class="type">QXxx</span> <span class="operator">&amp;</span>);
</pre>
<p>For example, here are the stream operators declared as
non-members of the <a href="qimage.html">QImage</a> class:</p>
<pre class="cpp">
 <span class="type">QDataStream</span> <span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">&lt;</span><span class="operator">&lt;</span> (<span class="type">QDataStream</span><span class="operator">&amp;</span> stream<span class="operator">,</span> <span class="keyword">const</span> <span class="type"><a href="qimage.html">QImage</a></span><span class="operator">&amp;</span> image);
 <span class="type">QDataStream</span> <span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">&gt;</span><span class="operator">&gt;</span> (<span class="type">QDataStream</span><span class="operator">&amp;</span> stream<span class="operator">,</span> <span class="type"><a href="qimage.html">QImage</a></span><span class="operator">&amp;</span> image);
</pre>
<p>To see if your favorite Qt class has similar stream operators
defined, check the <b>Related Non-Members</b> section of the
class's documentation page.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ByteOrder-enum" />QDataStream.ByteOrder</h3><p>The byte order used for reading/writing the data.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.BigEndian</tt></td>
<td class="topAlign"><tt>QSysInfo.BigEndian</tt></td>
<td class="topAlign">Most significant byte first (the default)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.LittleEndian</tt></td>
<td class="topAlign"><tt>QSysInfo.LittleEndian</tt></td>
<td class="topAlign">Least significant byte first</td>
</tr>
</table>


<h3 class="fn"><a name="FloatingPointPrecision-enum" />QDataStream.FloatingPointPrecision</h3><p>The precision of floating point numbers used for reading/writing
the data. This will only have an effect if the version of the data
stream is <a href="qdatastream.html#Version-enum">Qt_4_6</a> or
higher.</p>
<p><b>Warning:</b> The floating point precision must be set to the
same value on the object that writes and the object that reads the
data stream.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.SinglePrecision</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">All floating point numbers in the data stream
have 32-bit precision.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.DoublePrecision</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">All floating point numbers in the data stream
have 64-bit precision.</td>
</tr>
</table>
<p><b>See also</b> <a href="qdatastream.html#setFloatingPointPrecision">setFloatingPointPrecision</a>()
and <a href="qdatastream.html#floatingPointPrecision">floatingPointPrecision</a>().</p>


<h3 class="fn"><a name="Status-enum" />QDataStream.Status</h3><p>This enum describes the current status of the data stream.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Ok</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">The data stream is operating normally.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.ReadPastEnd</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">The data stream has read past the end of the
data in the underlying device.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.ReadCorruptData</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">The data stream has read corrupt data.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.WriteFailed</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">The data stream cannot write to the underlying
device.</td>
</tr>
</table>


<h3 class="fn"><a name="Version-enum" />QDataStream.Version</h3><p>This enum provides symbolic synonyms for the data serialization
format version numbers.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_1_0</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Version 1 (Qt 1.x)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_2_0</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Version 2 (Qt 2.0)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_2_1</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Version 3 (Qt 2.1, 2.2, 2.3)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_3_0</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">Version 4 (Qt 3.0)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_3_1</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">Version 5 (Qt 3.1, 3.2)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_3_3</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">Version 6 (Qt 3.3)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_0</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">Version 7 (Qt 4.0, Qt 4.1)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_1</tt></td>
<td class="topAlign"><tt>Qt_4_0</tt></td>
<td class="topAlign">Version 7 (Qt 4.0, Qt 4.1)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_2</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">Version 8 (Qt 4.2)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_3</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">Version 9 (Qt 4.3)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_4</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">Version 10 (Qt 4.4)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_5</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">Version 11 (Qt 4.5)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_6</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">Version 12 (Qt 4.6, Qt 4.7, Qt 4.8)</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_7</tt></td>
<td class="topAlign"><tt>Qt_4_6</tt></td>
<td class="topAlign">Same as Qt_4_6.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDataStream.Qt_4_8</tt></td>
<td class="topAlign"><tt>Qt_4_7 Qt_4_9 = Qt_4_8</tt></td>
<td class="topAlign">Same as Qt_4_6.</td>
</tr>
</table>
<p><b>See also</b> <a href="qdatastream.html#setVersion">setVersion</a>() and <a href="qdatastream.html#version">version</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDataStream" />QDataStream.__init__ (<i>self</i>)</h3><p>Constructs a data stream that has no I/O device.</p>
<p><b>See also</b> <a href="qdatastream.html#setDevice">setDevice</a>().</p>


<h3 class="fn"><a name="QDataStream-2" />QDataStream.__init__ (<i>self</i>, <a href="qiodevice.html">QIODevice</a>)</h3><p>Constructs a data stream that uses the I/O device <i>d</i>.</p>
<p><b>Warning:</b> If you use <a href="porting4.html#qsocket">QSocket</a> or <a href="porting4.html#qsocketdevice">QSocketDevice</a> as the I/O device
<i>d</i> for reading data, you must make sure that enough data is
available on the socket for the operation to successfully proceed;
<a href="qdatastream.html">QDataStream</a> does not have any means
to handle or recover from short-reads.</p>
<p><b>See also</b> <a href="qdatastream.html#setDevice">setDevice</a>() and <a href="qdatastream.html#device">device</a>().</p>


<h3 class="fn"><a name="QDataStream-3" />QDataStream.__init__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>, <a href="qiodevice-openmode.html">QIODevice.OpenMode</a>&#160;<i>flags</i>)</h3><h3 class="fn"><a name="QDataStream-4" />QDataStream.__init__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><p>Constructs a data stream that operates on a byte array,
<i>a</i>. The <i>mode</i> describes how the device is to be
used.</p>
<p>Alternatively, you can use <a href="qdatastream.html">QDataStream</a>(const <a href="qbytearray.html">QByteArray</a> &amp;) if you just want to read
from a byte array.</p>
<p>Since <a href="qbytearray.html">QByteArray</a> is not a <a href="qiodevice.html">QIODevice</a> subclass, internally a <a href="qbuffer.html">QBuffer</a> is created to wrap the byte array.</p>


<h3 class="fn"><a name="atEnd" />bool QDataStream.atEnd (<i>self</i>)</h3><p>Returns true if the I/O device has reached the end position (end
of the stream or file) or if there is no I/O device set; otherwise
returns false.</p>
<p><b>See also</b> <a href="qiodevice.html#atEnd">QIODevice.atEnd</a>().</p>


<h3 class="fn"><a name="byteOrder" /><a href="qdatastream.html#ByteOrder-enum">ByteOrder</a> QDataStream.byteOrder (<i>self</i>)</h3><p>Returns the current byte order setting -- either <a href="qdatastream.html#ByteOrder-enum">BigEndian</a> or <a href="qdatastream.html#ByteOrder-enum">LittleEndian</a>.</p>
<p><b>See also</b> <a href="qdatastream.html#setByteOrder">setByteOrder</a>().</p>


<h3 class="fn"><a name="device" /><a href="qiodevice.html">QIODevice</a> QDataStream.device (<i>self</i>)</h3><p>Returns the I/O device currently set, or 0 if no device is
currently set.</p>
<p><b>See also</b> <a href="qdatastream.html#setDevice">setDevice</a>().</p>


<h3 class="fn"><a name="floatingPointPrecision" /><a href="qdatastream.html#FloatingPointPrecision-enum">FloatingPointPrecision</a> QDataStream.floatingPointPrecision (<i>self</i>)</h3><p>Returns the floating point precision of the data stream.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qdatastream.html#FloatingPointPrecision-enum">FloatingPointPrecision</a>
and <a href="qdatastream.html#setFloatingPointPrecision">setFloatingPointPrecision</a>().</p>


<h3 class="fn"><a name="readBool" />bool QDataStream.readBool (<i>self</i>)</h3><h3 class="fn"><a name="readBytes" />str QDataStream.readBytes (<i>self</i>)</h3><p>Reads the buffer <i>s</i> from the stream and returns a
reference to the stream.</p>
<p>The buffer <i>s</i> is allocated using <tt>new</tt>. Destroy it
with the <tt>delete[]</tt> operator.</p>
<p>The <i>l</i> parameter is set to the length of the buffer. If
the string read is empty, <i>l</i> is set to 0 and <i>s</i> is set
to a null pointer.</p>
<p>The serialization format is a quint32 length specifier first,
then <i>l</i> bytes of data.</p>
<p><b>See also</b> <a href="qdatastream.html#readRawData">readRawData</a>() and <a href="qdatastream.html#writeBytes">writeBytes</a>().</p>


<h3 class="fn"><a name="readDouble" />float QDataStream.readDouble (<i>self</i>)</h3><h3 class="fn"><a name="readFloat" />float QDataStream.readFloat (<i>self</i>)</h3><h3 class="fn"><a name="readInt" />int QDataStream.readInt (<i>self</i>)</h3><h3 class="fn"><a name="readInt16" />int QDataStream.readInt16 (<i>self</i>)</h3><h3 class="fn"><a name="readInt32" />int QDataStream.readInt32 (<i>self</i>)</h3><h3 class="fn"><a name="readInt64" />int QDataStream.readInt64 (<i>self</i>)</h3><h3 class="fn"><a name="readInt8" />str QDataStream.readInt8 (<i>self</i>)</h3><h3 class="fn"><a name="readQString" />QString QDataStream.readQString (<i>self</i>)</h3><h3 class="fn"><a name="readQStringList" />QStringList QDataStream.readQStringList (<i>self</i>)</h3><h3 class="fn"><a name="readQVariant" />QVariant QDataStream.readQVariant (<i>self</i>)</h3><h3 class="fn"><a name="readQVariantHash" />dict-of-QString-QVariant QDataStream.readQVariantHash (<i>self</i>)</h3><h3 class="fn"><a name="readQVariantList" />list-of-QVariant QDataStream.readQVariantList (<i>self</i>)</h3><h3 class="fn"><a name="readQVariantMap" />dict-of-QString-QVariant QDataStream.readQVariantMap (<i>self</i>)</h3><h3 class="fn"><a name="readRawData" />str QDataStream.readRawData (<i>self</i>, int&#160;<i>len</i>)</h3><p>Reads at most <i>len</i> bytes from the stream into <i>s</i> and
returns the number of bytes read. If an error occurs, this function
returns -1.</p>
<p>The buffer <i>s</i> must be preallocated. The data is <i>not</i>
encoded.</p>
<p><b>See also</b> <a href="qdatastream.html#readBytes">readBytes</a>(), <a href="qiodevice.html#read">QIODevice.read</a>(), and <a href="qdatastream.html#writeRawData">writeRawData</a>().</p>


<h3 class="fn"><a name="readString" />str QDataStream.readString (<i>self</i>)</h3><h3 class="fn"><a name="readUInt16" />int QDataStream.readUInt16 (<i>self</i>)</h3><h3 class="fn"><a name="readUInt32" />int QDataStream.readUInt32 (<i>self</i>)</h3><h3 class="fn"><a name="readUInt64" />int QDataStream.readUInt64 (<i>self</i>)</h3><h3 class="fn"><a name="readUInt8" />str QDataStream.readUInt8 (<i>self</i>)</h3><h3 class="fn"><a name="resetStatus" />QDataStream.resetStatus (<i>self</i>)</h3><p>Resets the status of the data stream.</p>
<p><b>See also</b> <a href="qdatastream.html#Status-enum">Status</a>, <a href="qdatastream.html#status">status</a>(), and <a href="qdatastream.html#setStatus">setStatus</a>().</p>


<h3 class="fn"><a name="setByteOrder" />QDataStream.setByteOrder (<i>self</i>, <a href="qdatastream.html#ByteOrder-enum">ByteOrder</a>)</h3><p>Sets the serialization byte order to <i>bo</i>.</p>
<p>The <i>bo</i> parameter can be <a href="qdatastream.html#ByteOrder-enum">QDataStream.BigEndian</a> or
<a href="qdatastream.html#ByteOrder-enum">QDataStream.LittleEndian</a>.</p>
<p>The default setting is big endian. We recommend leaving this
setting unless you have special requirements.</p>
<p><b>See also</b> <a href="qdatastream.html#byteOrder">byteOrder</a>().</p>


<h3 class="fn"><a name="setDevice" />QDataStream.setDevice (<i>self</i>, <a href="qiodevice.html">QIODevice</a>)</h3><p>void QDataStream.setDevice(<a href="qiodevice.html">QIODevice</a> *d)</p>
<p>Sets the I/O device to <i>d</i>, which can be 0 to unset to
current I/O device.</p>
<p><b>See also</b> <a href="qdatastream.html#device">device</a>().</p>


<h3 class="fn"><a name="setFloatingPointPrecision" />QDataStream.setFloatingPointPrecision (<i>self</i>, <a href="qdatastream.html#FloatingPointPrecision-enum">FloatingPointPrecision</a>&#160;<i>precision</i>)</h3><p>Sets the floating point precision of the data stream to
<i>precision</i>. If the floating point precision is <a href="qdatastream.html#FloatingPointPrecision-enum">DoublePrecision</a>
and the version of the data stream is <a href="qdatastream.html#Version-enum">Qt_4_6</a> or higher, all floating
point numbers will be written and read with 64-bit precision. If
the floating point precision is <a href="qdatastream.html#FloatingPointPrecision-enum">SinglePrecision</a>
and the version is <a href="qdatastream.html#Version-enum">Qt_4_6</a> or higher, all floating
point numbers will be written and read with 32-bit precision.</p>
<p>For versions prior to <a href="qdatastream.html#Version-enum">Qt_4_6</a>, the precision of
floating point numbers in the data stream depends on the stream
operator called.</p>
<p>The default is <a href="qdatastream.html#FloatingPointPrecision-enum">DoublePrecision</a>.</p>
<p><b>Warning:</b> This property must be set to the same value on
the object that writes and the object that reads the data
stream.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qdatastream.html#floatingPointPrecision">floatingPointPrecision</a>().</p>


<h3 class="fn"><a name="setStatus" />QDataStream.setStatus (<i>self</i>, <a href="qdatastream.html#Status-enum">Status</a>&#160;<i>status</i>)</h3><p>Sets the status of the data stream to the <i>status</i>
given.</p>
<p>Subsequent calls to setStatus() are ignored until <a href="qdatastream.html#resetStatus">resetStatus</a>() is called.</p>
<p><b>See also</b> <a href="qdatastream.html#Status-enum">Status</a>, <a href="qdatastream.html#status">status</a>(), and <a href="qdatastream.html#resetStatus">resetStatus</a>().</p>


<h3 class="fn"><a name="setVersion" />QDataStream.setVersion (<i>self</i>, int&#160;<i>v</i>)</h3><p>Sets the version number of the data serialization format to
<i>v</i>.</p>
<p>You don't <i>have</i> to set a version if you are using the
current version of Qt, but for your own custom binary formats we
recommend that you do; see <a href="qdatastream.html#versioning">Versioning</a> in the Detailed
Description.</p>
<p>To accommodate new functionality, the datastream serialization
format of some Qt classes has changed in some versions of Qt. If
you want to read data that was created by an earlier version of Qt,
or write data that can be read by a program that was compiled with
an earlier version of Qt, use this function to modify the
serialization format used by <a href="qdatastream.html">QDataStream</a>.</p>
<table class="generic">
<thead>
<tr class="qt-style">
<th>Qt Version</th>
<th><a href="qdatastream.html">QDataStream</a> Version</th>
</tr>
</thead>
<tr class="odd" valign="top">
<td>Qt 4.6</td>
<td>12</td>
</tr>
<tr class="even" valign="top">
<td>Qt 4.5</td>
<td>11</td>
</tr>
<tr class="odd" valign="top">
<td>Qt 4.4</td>
<td>10</td>
</tr>
<tr class="even" valign="top">
<td>Qt 4.3</td>
<td>9</td>
</tr>
<tr class="odd" valign="top">
<td>Qt 4.2</td>
<td>8</td>
</tr>
<tr class="even" valign="top">
<td>Qt 4.0, 4.1</td>
<td>7</td>
</tr>
<tr class="odd" valign="top">
<td>Qt 3.3</td>
<td>6</td>
</tr>
<tr class="even" valign="top">
<td>Qt 3.1, 3.2</td>
<td>5</td>
</tr>
<tr class="odd" valign="top">
<td>Qt 3.0</td>
<td>4</td>
</tr>
<tr class="even" valign="top">
<td>Qt 2.1, 2.2, 2.3</td>
<td>3</td>
</tr>
<tr class="odd" valign="top">
<td>Qt 2.0</td>
<td>2</td>
</tr>
<tr class="even" valign="top">
<td>Qt 1.x</td>
<td>1</td>
</tr>
</table>
<p>The <a href="qdatastream.html#Version-enum">Version</a> enum
provides symbolic constants for the different versions of Qt. For
example:</p>
<pre class="cpp">
 <span class="type"><a href="qdatastream.html">QDataStream</a></span> out(file);
 out<span class="operator">.</span>setVersion(<span class="type"><a href="qdatastream.html">QDataStream</a></span><span class="operator">.</span>Qt_4_0);
</pre>
<p><b>See also</b> <a href="qdatastream.html#version">version</a>()
and <a href="qdatastream.html#Version-enum">Version</a>.</p>


<h3 class="fn"><a name="skipRawData" />int QDataStream.skipRawData (<i>self</i>, int&#160;<i>len</i>)</h3><p>Skips <i>len</i> bytes from the device. Returns the number of
bytes actually skipped, or -1 on error.</p>
<p>This is equivalent to calling <a href="qdatastream.html#readRawData">readRawData</a>() on a buffer of
length <i>len</i> and ignoring the buffer.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qiodevice.html#seek">QIODevice.seek</a>().</p>


<h3 class="fn"><a name="status" /><a href="qdatastream.html#Status-enum">Status</a> QDataStream.status (<i>self</i>)</h3><p>Returns the status of the data stream.</p>
<p><b>See also</b> <a href="qdatastream.html#Status-enum">Status</a>, <a href="qdatastream.html#setStatus">setStatus</a>(), and <a href="qdatastream.html#resetStatus">resetStatus</a>().</p>


<h3 class="fn"><a name="unsetDevice" />QDataStream.unsetDevice (<i>self</i>)</h3><h3 class="fn"><a name="version" />int QDataStream.version (<i>self</i>)</h3><p>Returns the version number of the data serialization format.</p>
<p><b>See also</b> <a href="qdatastream.html#setVersion">setVersion</a>() and <a href="qdatastream.html#Version-enum">Version</a>.</p>


<h3 class="fn"><a name="writeBool" />QDataStream.writeBool (<i>self</i>, bool&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeBytes" /><a href="qdatastream.html">QDataStream</a> QDataStream.writeBytes (<i>self</i>, str)</h3><p>Writes the length specifier <i>len</i> and the buffer <i>s</i>
to the stream and returns a reference to the stream.</p>
<p>The <i>len</i> is serialized as a quint32, followed by
<i>len</i> bytes from <i>s</i>. Note that the data is <i>not</i>
encoded.</p>
<p><b>See also</b> <a href="qdatastream.html#writeRawData">writeRawData</a>() and <a href="qdatastream.html#readBytes">readBytes</a>().</p>


<h3 class="fn"><a name="writeDouble" />QDataStream.writeDouble (<i>self</i>, float&#160;<i>f</i>)</h3><h3 class="fn"><a name="writeFloat" />QDataStream.writeFloat (<i>self</i>, float&#160;<i>f</i>)</h3><h3 class="fn"><a name="writeInt" />QDataStream.writeInt (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeInt16" />QDataStream.writeInt16 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeInt32" />QDataStream.writeInt32 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeInt64" />QDataStream.writeInt64 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeInt8" />QDataStream.writeInt8 (<i>self</i>, str&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeQString" />QDataStream.writeQString (<i>self</i>, QString&#160;<i>qstr</i>)</h3><h3 class="fn"><a name="writeQStringList" />QDataStream.writeQStringList (<i>self</i>, QStringList&#160;<i>qstrlst</i>)</h3><h3 class="fn"><a name="writeQVariant" />QDataStream.writeQVariant (<i>self</i>, QVariant&#160;<i>qvar</i>)</h3><h3 class="fn"><a name="writeQVariantHash" />QDataStream.writeQVariantHash (<i>self</i>, dict-of-QString-QVariant&#160;<i>qvarhash</i>)</h3><h3 class="fn"><a name="writeQVariantList" />QDataStream.writeQVariantList (<i>self</i>, list-of-QVariant&#160;<i>qvarlst</i>)</h3><h3 class="fn"><a name="writeQVariantMap" />QDataStream.writeQVariantMap (<i>self</i>, dict-of-QString-QVariant&#160;<i>qvarmap</i>)</h3><h3 class="fn"><a name="writeRawData" />int QDataStream.writeRawData (<i>self</i>, str)</h3><p>Writes <i>len</i> bytes from <i>s</i> to the stream. Returns the
number of bytes actually written, or -1 on error. The data is
<i>not</i> encoded.</p>
<p><b>See also</b> <a href="qdatastream.html#writeBytes">writeBytes</a>(), <a href="qiodevice.html#write">QIODevice.write</a>(), and <a href="qdatastream.html#readRawData">readRawData</a>().</p>


<h3 class="fn"><a name="writeString" />QDataStream.writeString (<i>self</i>, str&#160;<i>str</i>)</h3><h3 class="fn"><a name="writeUInt16" />QDataStream.writeUInt16 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeUInt32" />QDataStream.writeUInt32 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeUInt64" />QDataStream.writeUInt64 (<i>self</i>, int&#160;<i>i</i>)</h3><h3 class="fn"><a name="writeUInt8" />QDataStream.writeUInt8 (<i>self</i>, str&#160;<i>i</i>)</h3><h3 class="fn"><a name="__lshift__" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qcolor.html">QColor</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qnetworkcachemetadata.html">QNetworkCacheMetaData</a>)</h3><p>This method is only available if the QtNetwork module is imported.</p><h3 class="fn"><a name="__lshift__" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qscriptcontextinfo.html">QScriptContextInfo</a>)</h3><p>This method is only available if the QtScript module is imported.</p><h3 class="fn"><a name="__lshift__" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qwebhistory.html">QWebHistory</a>)</h3><p>This method is only available if the QtWebKit module is imported.</p><h3 class="fn"><a name="__lshift__-2" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qbrush.html">QBrush</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-2" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qhostaddress.html">QHostAddress</a>)</h3><p>This method is only available if the QtNetwork module is imported.</p><h3 class="fn"><a name="__lshift__-3" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qcursor.html">QCursor</a>&#160;<i>cursor</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-4" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-5" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qicon.html">QIcon</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-6" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qimage.html">QImage</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-7" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>ks</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-8" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-9" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qmatrix.html">QMatrix</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-10" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-11" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-12" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpalette.html">QPalette</a>&#160;<i>p</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-13" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpen.html">QPen</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-14" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpicture.html">QPicture</a>&#160;<i>p</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-15" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-16" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>array</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-17" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a>&#160;<i>polygon</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-18" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qquaternion.html">QQuaternion</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-19" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qregion.html">QRegion</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-20" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qsizepolicy.html">QSizePolicy</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-22" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qstandarditem.html">QStandardItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-23" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-24" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-25" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qtextformat.html">QTextFormat</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-26" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qtransform.html">QTransform</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-27" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qtreewidgetitem.html">QTreeWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-28" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qvector2d.html">QVector2D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-29" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qvector3d.html">QVector3D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__-30" /><a href="qdatastream.html">QDataStream</a> __lshift__ (<i>self</i>, <a href="qvector4d.html">QVector4D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qcolor.html">QColor</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qnetworkcachemetadata.html">QNetworkCacheMetaData</a>)</h3><p>This method is only available if the QtNetwork module is imported.</p><h3 class="fn"><a name="__rshift__" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qscriptcontextinfo.html">QScriptContextInfo</a>)</h3><p>This method is only available if the QtScript module is imported.</p><h3 class="fn"><a name="__rshift__" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qwebhistory.html">QWebHistory</a>)</h3><p>This method is only available if the QtWebKit module is imported.</p><h3 class="fn"><a name="__rshift__-2" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qbrush.html">QBrush</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-2" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qhostaddress.html">QHostAddress</a>)</h3><p>This method is only available if the QtNetwork module is imported.</p><h3 class="fn"><a name="__rshift__-3" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qcursor.html">QCursor</a>&#160;<i>cursor</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-4" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qfont.html">QFont</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-5" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qicon.html">QIcon</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-6" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qimage.html">QImage</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-7" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qkeysequence.html">QKeySequence</a>&#160;<i>ks</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-8" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qlistwidgetitem.html">QListWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-9" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qmatrix.html">QMatrix</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-10" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qmatrix4x4.html">QMatrix4x4</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-11" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpainterpath.html">QPainterPath</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-12" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpalette.html">QPalette</a>&#160;<i>p</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-13" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpen.html">QPen</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-14" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpicture.html">QPicture</a>&#160;<i>p</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-15" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpixmap.html">QPixmap</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-16" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpolygonf.html">QPolygonF</a>&#160;<i>array</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-17" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a>&#160;<i>polygon</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-18" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qquaternion.html">QQuaternion</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-19" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qregion.html">QRegion</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-20" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qsizepolicy.html">QSizePolicy</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-22" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qstandarditem.html">QStandardItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-23" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qtablewidgetitem.html">QTableWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-24" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qtextlength.html">QTextLength</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-25" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qtextformat.html">QTextFormat</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-26" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qtransform.html">QTransform</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-27" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qtreewidgetitem.html">QTreeWidgetItem</a>&#160;<i>item</i>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-28" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qvector2d.html">QVector2D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-29" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qvector3d.html">QVector3D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__rshift__-30" /><a href="qdatastream.html">QDataStream</a> __rshift__ (<i>self</i>, <a href="qvector4d.html">QVector4D</a>)</h3><p>This method is only available if the QtGui module is imported.</p><h3 class="fn"><a name="__lshift__" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qbitarray.html">QBitArray</a>)</h3><h3 class="fn"><a name="__lshift__-2" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><h3 class="fn"><a name="__lshift__-3" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, QChar)</h3><h3 class="fn"><a name="__lshift__-4" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qdate.html">QDate</a>)</h3><h3 class="fn"><a name="__lshift__-5" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qtime.html">QTime</a>)</h3><h3 class="fn"><a name="__lshift__-6" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qdatetime.html">QDateTime</a>)</h3><h3 class="fn"><a name="__lshift__-7" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qeasingcurve.html">QEasingCurve</a>)</h3><h3 class="fn"><a name="__lshift__-8" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qline.html">QLine</a>)</h3><h3 class="fn"><a name="__lshift__-9" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qlinef.html">QLineF</a>)</h3><h3 class="fn"><a name="__lshift__-10" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qlocale.html">QLocale</a>)</h3><h3 class="fn"><a name="__lshift__-11" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><h3 class="fn"><a name="__lshift__-12" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><h3 class="fn"><a name="__lshift__-13" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qrect.html">QRect</a>)</h3><h3 class="fn"><a name="__lshift__-14" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qrectf.html">QRectF</a>)</h3><h3 class="fn"><a name="__lshift__-15" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qregexp.html">QRegExp</a>&#160;<i>regExp</i>)</h3><h3 class="fn"><a name="__lshift__-16" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qsize.html">QSize</a>)</h3><h3 class="fn"><a name="__lshift__-17" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qsizef.html">QSizeF</a>)</h3><h3 class="fn"><a name="__lshift__-18" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, QString)</h3><h3 class="fn"><a name="__lshift__-19" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, QStringList&#160;<i>list</i>)</h3><h3 class="fn"><a name="__lshift__-20" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qurl.html">QUrl</a>)</h3><h3 class="fn"><a name="__lshift__-21" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="quuid.html">QUuid</a>)</h3><h3 class="fn"><a name="__lshift__-22" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, QVariant&#160;<i>p</i>)</h3><h3 class="fn"><a name="__lshift__-23" /><a href="qdatastream.html">QDataStream</a> QDataStream.__lshift__ (<i>self</i>, <a href="qtcore.html#Type-enum">Type</a>&#160;<i>p</i>)</h3><h3 class="fn"><a name="__rshift__" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qbitarray.html">QBitArray</a>)</h3><h3 class="fn"><a name="__rshift__-2" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qbytearray.html">QByteArray</a>)</h3><h3 class="fn"><a name="__rshift__-3" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, QChar)</h3><h3 class="fn"><a name="__rshift__-4" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qdate.html">QDate</a>)</h3><h3 class="fn"><a name="__rshift__-5" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qtime.html">QTime</a>)</h3><h3 class="fn"><a name="__rshift__-6" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qdatetime.html">QDateTime</a>)</h3><h3 class="fn"><a name="__rshift__-7" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qeasingcurve.html">QEasingCurve</a>)</h3><h3 class="fn"><a name="__rshift__-8" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qline.html">QLine</a>)</h3><h3 class="fn"><a name="__rshift__-9" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qlinef.html">QLineF</a>)</h3><h3 class="fn"><a name="__rshift__-10" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qlocale.html">QLocale</a>)</h3><h3 class="fn"><a name="__rshift__-11" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qpoint.html">QPoint</a>)</h3><h3 class="fn"><a name="__rshift__-12" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qpointf.html">QPointF</a>)</h3><h3 class="fn"><a name="__rshift__-13" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qrect.html">QRect</a>)</h3><h3 class="fn"><a name="__rshift__-14" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qrectf.html">QRectF</a>)</h3><h3 class="fn"><a name="__rshift__-15" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qregexp.html">QRegExp</a>&#160;<i>regExp</i>)</h3><h3 class="fn"><a name="__rshift__-16" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qsize.html">QSize</a>)</h3><h3 class="fn"><a name="__rshift__-17" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qsizef.html">QSizeF</a>)</h3><h3 class="fn"><a name="__rshift__-18" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, QString)</h3><h3 class="fn"><a name="__rshift__-19" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, QStringList&#160;<i>list</i>)</h3><h3 class="fn"><a name="__rshift__-20" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qurl.html">QUrl</a>)</h3><h3 class="fn"><a name="__rshift__-21" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="quuid.html">QUuid</a>)</h3><h3 class="fn"><a name="__rshift__-22" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, QVariant&#160;<i>p</i>)</h3><h3 class="fn"><a name="__rshift__-23" /><a href="qdatastream.html">QDataStream</a> QDataStream.__rshift__ (<i>self</i>, <a href="qtcore.html#Type-enum">Type</a>&#160;<i>p</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>